<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
	<head>
		<title >cometd test</title>
		<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> 	
		<script type="text/javascript" src="js/jquery.comet.js"></script> 	
	</head>
	<body>
		<wicket:panel>
			
			<script type="text/javascript" wicket:id="script">

				var lastUpdate = 0;
			
				function onNotify( id, currentVersion )
				{
					lastUpdate = currentVersion;			
					wicketAjaxGet( callbackUrl+"&channels="+id );
				}	
			
				function connect()
				{
					$.ajax({
						url: "http://localhost:8080/chat",
						dataType:'script',
						beforeSend: function(oXhr) { oXhr.setRequestHeader('Connection', 'Keep-Alive'); },
						data: "channels="+channels+"&lastUpdate="+lastUpdate+"&connectionId="+connectionId,
						complete: function(){ connect(); },
						error: function(){  connect(); }
					});
				}
				//connect();
				setTimeout( "connect();",100 );		

			</script>	
		</wicket:panel>
	</body>
</html>